{% extends 'base_accounts.html' %}

{% block title %}
    {% if validlink %}
        为 {{ form.user.username }} 更改密码
    {% else %}
        重置密码
    {% endif %}
{% endblock %}

{% block content %}
    <div class="row justify-content-center">
        <div class="col-lg-6 col-md-8 col-sm-10">
            <div class="card">
                <div class="card-body">
                    {% if validlink %}
                        <h3 class="card-title">为 @{{ form.user.username }}更改密码</h3>
                        <form method="post" novalidate>
                            {% csrf_token %}
                            {% include 'includes/form.html' %}
                            <button type="submit" class="btn btn-success btn-block">更改密码</button>
                        </form>
                    {% else %}
                        <h3 class="card-title">重置密码</h3>
                        <div class="alert alert-danger" role="alert">
                            看起来好像你好像点击了一个无效的密码重置链接，再试一遍吧？
                        </div>
                        <a href="{% url 'password_reset' %}" class="btn btn-secondary btn-block">
                            申请一个新的修改密码的链接
                        </a>
                    {% endif %}
                </div>
            </div>
        </div>
    </div>
{% endblock %}